import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/common/Home.vue')
  },
  {
    path: '/docs',
    name: 'Docs',
    component: () => import('@/views/common/docs-route.vue'),
    children: [
      {
        path: 'installation',
        name: 'Installation',
        component: () => import('../docs/installation.md')
      },
      {
        path: 'testMd',
        name: 'testMd',
        component: () => import('../docs/编写指南.md')
      },
      {
        path: 'progressOne',
        name: 'progressOne',
        component: () => import('../docs/progressOne.md')
      },
      {
        path: 'title-land',
        name: 'titleLand',
        component: () => import('../docs/title.md')
      },
      {
        path: 'title-secondary-land',
        name: 'titleSecondaryLand',
        component: () => import('../docs/titleSecondary.md')
      },
      {
        path: "/docs/map/map-picker",
        name: "mapPicker",
        component: () => import('../docs/map/mapPicker.md')
      },
      {
        path: '/docs/data-eye-box',
        name: 'DataEyeBox',
        component: () => import('../docs/dataEyeBox.md')
      },
      {
        path: '/docs/fold-box',
        name: 'FoldBox',
        component: () => import('../docs/foldBox.md')
      },
      {
        path: '/docs/preview-pic',
        name: 'PreviewPic',
        component: () => import('../docs/previewPic.md')
      },
      {
        path: '/docs/rank',
        name: 'Rank',
        component: () => import('../docs/rank.md')
      },
      // ===================================  自用 start ======================
      {
        path: '/docs/demo',
        name: 'Demo',
        component: () => import('../docs/demo.md')
      },
      // 一些案例
      {
        path: '/docs/css/filter',
        name: 'docs-css-filter',
        component: () => import('../docs/case/CSS_filter.md')
      },
      {
        path: '/docs/case/lyr',
        name: 'docs-case-lyr',
        component: () => import('../docs/case/Lyrics_Scrolling.md')
      },
      // 常见问题
      // cors
      {
        path: '/docs/question/cors',
        name: 'docs-question-cors',
        component: () => import('../docs/question/cors.md')
      },
      {
        path: '/docs/question/ajax',
        name: 'docs-question-ajax',
        component: () => import('../docs/question/Ajax.md')
      },
      {
        path: '/docs/question/EventLoop',
        name: 'docs-question-eventloop',
        component: () => import('../docs/question/EventLoop.md')
      },
      {
        path: '/docs/question/BrowserRender',
        name: 'docs-question-browserrender',
        component: () => import('../docs/question/BrowserRender.md')
      }
      // ===================================  自用 over ======================
    ]
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
